/**
 * 获取值
 * @param key
 * @returns
 */
export function getLocal(key: string) {
  return JSON.parse(localStorage.getItem(key));
}

/**
 * 设置值
 * @param key
 * @param value
 */
export function setLocal(key: string, value: any) {
  if (typeof value === "object" && value !== null) {
    localStorage.setItem(key, JSON.stringify(value));
  } else {
    localStorage.setItem(key, value);
  }
}
